
<%--
  Created by IntelliJ IDEA.
  User: zsw
  Date: 2021/11/9
  Time: 0:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
  <head>
    <title>用户列表</title>
  </head>
  <body>
  <table border="1" width="50%" align="center" style="text-align: center;">
    <tr>
      <td colspan="4">用户信息表</td>
    </tr>
    <tr>
      <td colspan="2"><a href="${pageContext.request.contextPath}/userAdd.jsp">添加用户</a></td>
    </tr>
    <tr>
      <td>用户id</td>
      <td>用户名</td>
      <td>密码</td>
      <td>操作</td>
    </tr>
    <c:forEach items="${userList}" var="userItem" varStatus="id">
      <tr>
        <td>${userItem.id}</td>
        <td>${userItem.username}</td>
        <td>${userItem.password}</td>
        <td>
          <a href="${pageContext.request.contextPath}/user/detail?id=${userItem.id}">修改</a>
          <a href="${pageContext.request.contextPath}/user/delete?id=${userItem.id}">删除</a>
        </td>
      </tr>
    </c:forEach>

    <tr>
      <td>用户总数</td>
      <td colspan="3">${userCount}</td>
    </tr>

    <tr>
      <td>操作提示</td>
      <td colspan="3"><font color="red">${msg}</font></td>
    </tr>

  </table>
  </body>
</html>
